package com.example.meetingroomnew.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
@Data
@TableName(value = "reservation")
public class Reservation {

  public static final Integer WAITING=0;
  public static final Integer ACCEPT  = 2;
  public static final Integer  REJECT= 1;

  @TableId(type = IdType.AUTO)
  protected int id  ;
  protected int userId ;
  protected int roomId ;
  @DateTimeFormat(pattern = "yyyy-MM-ddTHH:mm:ss.000Z")
//  @JsonFormat(pattern = "yyyy-MM-ddTHH:mm:ss.000Z",timezone = "GMT+8")
  protected    Date startTime ;

  @DateTimeFormat(pattern = "yyyy-MM-ddTHH:mm:ss.000Z")
//  @JsonFormat(pattern = "yyyy-MM-ddTHH:mm:ss.000Z",timezone = "GMT+8")
  protected     Date endTime ;
  protected    String subject ;
  @DateTimeFormat(pattern = "yyyy-MM-ddTHH:mm:ss.000Z")
//@JsonFormat(pattern = "yyyy-MM-ddTHH:mm:ss.000Z",timezone = "GMT+8")
  protected Date  approvalTime ;
  protected String  rejectionReason ;
  protected int  status;
  protected int  attendees;

  public Reservation(int id, int userId, int roomId, Date startTime, Date endTime, String subject, Date approvalTime, String rejectionReason, int status, int attendees) {
    this.id = id;
    this.userId = userId;
    this.roomId = roomId;
    this.startTime = startTime;
    this.endTime = endTime;
    this.subject = subject;
    this.approvalTime = approvalTime;
    this.rejectionReason = rejectionReason;
    this.status = status;
    this.attendees = attendees;
  }
}
